home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 8: LINUX Games
/
Linux Cubed Series 8 - LINUX Games.iso
/
games
/
x11
/
networke
/
civ-0.000
/
civ-0
/
civ-0.3
/
src
/
rules.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-11-15
|
2KB
|
70 lines
#ifndef _RULES_H
#define _RULES_H
#include "mytypes.h"
#include "list.h"
#include "hash.h"
enum {
COPERNICUS, BANK, COLOSSUS, TEMPLE, COURTHOUSE, UNITEDNATIONS,
SETIPROGRAM, AQUADUCT, COLOSSEUM, MARKETPLACE, HYDROPLANT,
HOOVERDAM, CUREFORCANCER, FACTORY, WOMENSSUFFRAGE, GREATLIBRARY,
LIGHTHOUSE, PALACE, CITYWALLS, PYRAMIDS, GREATWALL, MASSTRANSIT,
SHAKESPEARE, ORACLE, MAGELLAN, MANHATTAN, GRANARY, HANGINGGARDENS,
DARWIN, RECYCLINGCTR, POWERPLANT, NUCLEARPLANT, FUSIONPLANT, CATHEDRAL,
MICHELANGELO, JSBACH, MFGPLANT, SDIDEFENSE, ISAACNEWTON, UNIVERSITY,
LIBRARY
};
class StrKey;
struct Science
{
char *name;
List<charp> need;
List<charp> canBuild;
// each player sets a bit in here if he's discovered it
char *wonderObsolete; // which wonder we make obsolete
ulong discovered;
};
struct BuildObject
{
char *name;
int type;
uchar unit; // true if it is a unit
uchar wonder; // true if wonder
ushort prodCost;
uchar maint;
uchar built; // if its a wonder has it been built or not
uchar isObsolete; // if its a wonder, is it obsolete
char *line;
List<charp> neededObj;
char *obsolete; // thing which we make obsolete
};
extern HashTable<Science, StrKey> sciences;
extern HashTable<BuildObject, StrKey> buildObjects;
// call this after the world is set up
void InitializeRules();
void InitialScience(int player, List<charp> &discovered,
List<charp> &canDiscover, List<charp> &canBuild,
List<charp> &canGovern);
void Discover(int player, char *science, List<charp> &discovered,
List<charp> &canDiscover, List<charp> &canBuild,
List<charp> &canGovern);
int Discovered(int player, char *science);
int DiscoverCost(int player, Science *ptr);
int WonderObsolete(BuildObject *wonder, int player);
void SaveRules();
void RestoreRules();
#endif